// pages/editAddress/editAddress.js
const addressService = require('../../service/addressService.js')
const utils = require('../../utils/util.js');
// load promise 
require('../../utils/wx-pro.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    addressInfo: {}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (option) {
    console.log(option.id)
    var params = {
      addressId: option.id
    }
    addressService.getXcxAddress(params).then(data => {
      if (data.code == 200) {
        console.log(data.response.orderAddress)
        this.setData({
          addressInfo: data.response.orderAddress
        })
      }
    })
    .catch(() => {
      console.log('error')
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function (options) {

  }

})